home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7630 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: news.jhu.edu!news
  2. From: Chenyang Xu <chenyang@mashie.ece.jhu.edu>
  3. Newsgroups: comp.lang.c
  4. Subject: about free()
  5. Date: Tue, 27 Feb 1996 11:41:56 -0500
  6. Organization: ECE Department, The Johns Hopkins University
  7. Message-ID: <31333454.167E@mashie.ece.jhu.edu>
  8. NNTP-Posting-Host: 128.220.14.190
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (X11; I; IRIX 5.2 IP22)
  13.  
  14. Hi, there,
  15.  
  16.      I have a simple question here.
  17.  
  18.      I have a function say newarrary() which mallocs an array inside and
  19. returns a pointer to this arrary. In another function foo.c, the result
  20. of newarray() is assigned to a pointer ptr. Now after some operations on
  21. this array. I use free(ptr) to free the memory allocated by newarrary().
  22. My question is whould this cause a problem, since free() is not freeing
  23. the same pointer which is allocated by the malloc() although this
  24. pointer point to the same memory.
  25.  
  26. -- 
  27. Chenyang
  28.  
  29.                               \\|//
  30.                               (o o)
  31.  --------------------------ooO-(_)-Ooo----------------------------------
  32.    (o) 410-516-6819             |   Fax:410-516-5566
  33.    chenyang@jhu.edu             |   http://iacl.ece.jhu.edu/~chenyang      
  34.          _________________________________________________________
  35.         /          Image Analysis and Communication Lab          /
  36.        /   Department of the  Electric and Computer Engineering /
  37.       /         The Johns Hopkins University                   /  
  38.      /             Baltimore, MD 21218                        /
  39.  =======================================================================
  40.